<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="initial-scale=1.0, maximum-scale=1.0, user-scalable=no"/>
    <title></title>
    <div>
        <h3></h3>
    </div>
    <div>
        <h3>方法</h3>
        <p onclick="smsTest()">创建发送短信</p>
        <p onclick="mailTest()">创建发送邮件</p>
    </div>
    <script type="text/javascript">
        // 方法
        // 扩展API加载完毕后调用onPlusReady回调函数
        document.addEventListener("plusready", onPlusReady, false);
        // 扩展API加载完毕，现在可以正常调用扩展API
        function onPlusReady() {}

        //短信
        function smsTest(){
            var msg = plus.messaging.createMessage(plus.messaging.TYPE_SMS);
            msg.to = ['18611497504', '15811140520'];
            msg.body = 'This is HTML5 Plus example test message';
            plus.messaging.sendMessage( msg );
        }

        //邮件
        function mailTest(){
            var msg = plus.messaging.createMessage(plus.messaging.TYPE_EMAIL);
            msg.to = ['test@163.com', 'test@173.com'];
            msg.cc = ['test@163.com', 'test@173.com'];
            msg.bcc = ['test@163.com', 'test@173.com'];
            msg.subject = '测试邮件';
            msg.body = 'This is Pandora example test message';
            msg.addAttachment("_www/a.doc");
            plus.messaging.sendMessage( msg, function () {
                alert( "Send success!" );
            }, function () {
                alert( "Send failed!" );
            } );
        }
    </script>
</head>
<body>

</body>
</html>